<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.14"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>FabGL: soundgen.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  $(document).ready(initResizable);
/* @license-end */</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="doxygen-awesome.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">FabGL
   </div>
   <div id="projectbrief">ESP32 Display Controller and Graphics Library</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.14 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('soundgen_8h_source.html','');});
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">soundgen.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="soundgen_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">/*</span></div><div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment">  Created by Fabrizio Di Vittorio (fdivitto2013@gmail.com) - &lt;http://www.fabgl.com&gt;</span></div><div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment">  Copyright (c) 2019-2021 Fabrizio Di Vittorio.</span></div><div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment">  All rights reserved.</span></div><div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment"></span></div><div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment"></span></div><div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment">* Please contact fdivitto2013@gmail.com if you need a commercial license.</span></div><div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment"></span></div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="comment"></span></div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="comment">* This library and related software is available under GPL v3.</span></div><div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="comment"></span></div><div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="comment">  FabGL is free software: you can redistribute it and/or modify</span></div><div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="comment">  it under the terms of the GNU General Public License as published by</span></div><div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="comment">  the Free Software Foundation, either version 3 of the License, or</span></div><div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="comment">  (at your option) any later version.</span></div><div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="comment"></span></div><div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="comment">  FabGL is distributed in the hope that it will be useful,</span></div><div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="comment">  but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div><div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="comment">  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div><div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="comment">  GNU General Public License for more details.</span></div><div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="comment"></span></div><div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;<span class="comment">  You should have received a copy of the GNU General Public License</span></div><div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;<span class="comment">  along with FabGL.  If not, see &lt;http://www.gnu.org/licenses/&gt;.</span></div><div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;<span class="comment"> */</span></div><div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;</div><div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;</div><div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;<span class="preprocessor">#pragma once</span></div><div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;</div><div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;</div><div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;<span class="preprocessor">#include &lt;stdint.h&gt;</span></div><div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;<span class="preprocessor">#include &lt;stddef.h&gt;</span></div><div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;</div><div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;<span class="preprocessor">#include &quot;freertos/FreeRTOS.h&quot;</span></div><div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;</div><div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="fabglconf_8h.html">fabglconf.h</a>&quot;</span></div><div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="fabutils_8h.html">fabutils.h</a>&quot;</span></div><div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;</div><div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;</div><div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;</div><div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespacefabgl.html">fabgl</a> {</div><div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;</div><div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;</div><div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;<span class="preprocessor">#define DEFAULT_SAMPLE_RATE 16000</span></div><div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;</div><div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;<span class="comment">// 512 samples, at 16KHz generate a send every 512/16000*1000 = 32ms (16000/512=31.25 sends per second)</span></div><div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;<span class="comment">// 200 samples, at 16Khz generate a send every 200/16000*1000 = 12.5ms (16000/200=80 sends per second)</span></div><div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;<span class="preprocessor">#define I2S_SAMPLE_BUFFER_SIZE 200  // must be even</span></div><div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;</div><div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;<span class="preprocessor">#define WAVEGENTASK_STACK_SIZE 2000</span></div><div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;</div><div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;</div><div class="line"><a name="l00062"></a><span class="lineno"><a class="line" href="classfabgl_1_1_waveform_generator.html">   62</a></span>&#160;<span class="keyword">class </span><a class="code" href="classfabgl_1_1_waveform_generator.html">WaveformGenerator</a> {</div><div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;<span class="keyword">public</span>:</div><div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;  <a class="code" href="classfabgl_1_1_waveform_generator.html">WaveformGenerator</a>() : next(<span class="keyword">nullptr</span>), m_sampleRate(0), m_volume(100), m_enabled(<span class="keyword">false</span>), m_duration(-1), m_autoDestroy(<span class="keyword">false</span>), m_autoDetach(<span class="keyword">false</span>) { }</div><div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;</div><div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;  <span class="keyword">virtual</span> ~<a class="code" href="classfabgl_1_1_waveform_generator.html">WaveformGenerator</a>() { }</div><div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;</div><div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;  <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classfabgl_1_1_waveform_generator_a6d3ded07c8e0000d3f20c12ed801db7b.html#a6d3ded07c8e0000d3f20c12ed801db7b">setFrequency</a>(<span class="keywordtype">int</span> value) = 0;</div><div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;</div><div class="line"><a name="l00080"></a><span class="lineno"><a class="line" href="classfabgl_1_1_waveform_generator_aae62a0a75472fde81f63cd0f9d9288c2.html#aae62a0a75472fde81f63cd0f9d9288c2">   80</a></span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classfabgl_1_1_waveform_generator_aae62a0a75472fde81f63cd0f9d9288c2.html#aae62a0a75472fde81f63cd0f9d9288c2">setDuration</a>(uint32_t value) { m_duration = value; }</div><div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;</div><div class="line"><a name="l00087"></a><span class="lineno"><a class="line" href="classfabgl_1_1_waveform_generator_a996f2f6c960641738fc46d3f39f6ef6f.html#a996f2f6c960641738fc46d3f39f6ef6f">   87</a></span>&#160;  uint32_t <a class="code" href="classfabgl_1_1_waveform_generator_a996f2f6c960641738fc46d3f39f6ef6f.html#a996f2f6c960641738fc46d3f39f6ef6f">duration</a>() { <span class="keywordflow">return</span> m_duration; }</div><div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;</div><div class="line"><a name="l00094"></a><span class="lineno"><a class="line" href="classfabgl_1_1_waveform_generator_ace43e846a26854aa34091e3eabd07f24.html#ace43e846a26854aa34091e3eabd07f24">   94</a></span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classfabgl_1_1_waveform_generator_ace43e846a26854aa34091e3eabd07f24.html#ace43e846a26854aa34091e3eabd07f24">setAutoDetach</a>(<span class="keywordtype">bool</span> value) { m_autoDetach = value; }</div><div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;</div><div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;  <span class="keywordtype">bool</span> autoDetach() { <span class="keywordflow">return</span> m_autoDetach; }</div><div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;</div><div class="line"><a name="l00103"></a><span class="lineno"><a class="line" href="classfabgl_1_1_waveform_generator_a2670d55a6f6725717133799223effc61.html#a2670d55a6f6725717133799223effc61">  103</a></span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classfabgl_1_1_waveform_generator_a2670d55a6f6725717133799223effc61.html#a2670d55a6f6725717133799223effc61">setAutoDestroy</a>(<span class="keywordtype">bool</span> value) { m_autoDestroy = value; m_autoDetach |= value; }</div><div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;</div><div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;  <span class="keywordtype">bool</span> autoDestroy() { <span class="keywordflow">return</span> m_autoDestroy; }</div><div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;</div><div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;  <span class="keyword">virtual</span> <span class="keywordtype">int</span> <a class="code" href="classfabgl_1_1_waveform_generator_af6efc18f13f1cd2aeb2fb810b103b356.html#af6efc18f13f1cd2aeb2fb810b103b356">getSample</a>() = 0;</div><div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;</div><div class="line"><a name="l00119"></a><span class="lineno"><a class="line" href="classfabgl_1_1_waveform_generator_a77a669d4f95b8abf529a7d3183acb432.html#a77a669d4f95b8abf529a7d3183acb432">  119</a></span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classfabgl_1_1_waveform_generator_a77a669d4f95b8abf529a7d3183acb432.html#a77a669d4f95b8abf529a7d3183acb432">setVolume</a>(<span class="keywordtype">int</span> value) { m_volume = value; }</div><div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;</div><div class="line"><a name="l00126"></a><span class="lineno"><a class="line" href="classfabgl_1_1_waveform_generator_a56fd55a21e8060769938c33ac16ee4f2.html#a56fd55a21e8060769938c33ac16ee4f2">  126</a></span>&#160;  <span class="keywordtype">int</span> <a class="code" href="classfabgl_1_1_waveform_generator_a56fd55a21e8060769938c33ac16ee4f2.html#a56fd55a21e8060769938c33ac16ee4f2">volume</a>() { <span class="keywordflow">return</span> m_volume; }</div><div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;</div><div class="line"><a name="l00133"></a><span class="lineno"><a class="line" href="classfabgl_1_1_waveform_generator_acafb7271189f6d844921794d61cd608a.html#acafb7271189f6d844921794d61cd608a">  133</a></span>&#160;  <span class="keywordtype">bool</span> <a class="code" href="classfabgl_1_1_waveform_generator_acafb7271189f6d844921794d61cd608a.html#acafb7271189f6d844921794d61cd608a">enabled</a>() { <span class="keywordflow">return</span> m_enabled; }</div><div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;</div><div class="line"><a name="l00142"></a><span class="lineno"><a class="line" href="classfabgl_1_1_waveform_generator_a4d003299b7939c5c2a6fd8cee4fe7504.html#a4d003299b7939c5c2a6fd8cee4fe7504">  142</a></span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classfabgl_1_1_waveform_generator_a4d003299b7939c5c2a6fd8cee4fe7504.html#a4d003299b7939c5c2a6fd8cee4fe7504">enable</a>(<span class="keywordtype">bool</span> value) { m_enabled = value; }</div><div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;</div><div class="line"><a name="l00151"></a><span class="lineno"><a class="line" href="classfabgl_1_1_waveform_generator_a85fa2eb2cf3e487be53c8b2625bdce69.html#a85fa2eb2cf3e487be53c8b2625bdce69">  151</a></span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classfabgl_1_1_waveform_generator_a85fa2eb2cf3e487be53c8b2625bdce69.html#a85fa2eb2cf3e487be53c8b2625bdce69">setSampleRate</a>(<span class="keywordtype">int</span> value) { m_sampleRate = value; }</div><div class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160;</div><div class="line"><a name="l00158"></a><span class="lineno"><a class="line" href="classfabgl_1_1_waveform_generator_abc395029362d9990b5dad44dfafe9d63.html#abc395029362d9990b5dad44dfafe9d63">  158</a></span>&#160;  uint16_t <a class="code" href="classfabgl_1_1_waveform_generator_abc395029362d9990b5dad44dfafe9d63.html#abc395029362d9990b5dad44dfafe9d63">sampleRate</a>() { <span class="keywordflow">return</span> m_sampleRate; }</div><div class="line"><a name="l00159"></a><span class="lineno">  159</span>&#160;</div><div class="line"><a name="l00160"></a><span class="lineno">  160</span>&#160;  <a class="code" href="classfabgl_1_1_waveform_generator.html">WaveformGenerator</a> * next;</div><div class="line"><a name="l00161"></a><span class="lineno">  161</span>&#160;</div><div class="line"><a name="l00162"></a><span class="lineno">  162</span>&#160;<span class="keyword">protected</span>:</div><div class="line"><a name="l00163"></a><span class="lineno">  163</span>&#160;</div><div class="line"><a name="l00164"></a><span class="lineno">  164</span>&#160;  <span class="keywordtype">void</span> decDuration() { --m_duration; <span class="keywordflow">if</span> (m_duration == 0) m_enabled = <span class="keyword">false</span>; }</div><div class="line"><a name="l00165"></a><span class="lineno">  165</span>&#160;</div><div class="line"><a name="l00166"></a><span class="lineno">  166</span>&#160;<span class="keyword">private</span>:</div><div class="line"><a name="l00167"></a><span class="lineno">  167</span>&#160;  uint16_t m_sampleRate;</div><div class="line"><a name="l00168"></a><span class="lineno">  168</span>&#160;  int8_t   m_volume;</div><div class="line"><a name="l00169"></a><span class="lineno">  169</span>&#160;  int8_t   m_enabled;   <span class="comment">// 0 = disabled, 1 = enabled</span></div><div class="line"><a name="l00170"></a><span class="lineno">  170</span>&#160;  uint32_t m_duration;  <span class="comment">// number of samples to play (-1 = infinite)</span></div><div class="line"><a name="l00171"></a><span class="lineno">  171</span>&#160;  <span class="keywordtype">bool</span>     m_autoDestroy; <span class="comment">// if true: this object needs to be destroyed by the sound generator when there are no more samples to play</span></div><div class="line"><a name="l00172"></a><span class="lineno">  172</span>&#160;  <span class="keywordtype">bool</span>     m_autoDetach;  <span class="comment">// if true: this object needs to be autodetached from the sound generator when there are no more samples to play</span></div><div class="line"><a name="l00173"></a><span class="lineno">  173</span>&#160;};</div><div class="line"><a name="l00174"></a><span class="lineno">  174</span>&#160;</div><div class="line"><a name="l00175"></a><span class="lineno">  175</span>&#160;</div><div class="line"><a name="l00177"></a><span class="lineno"><a class="line" href="classfabgl_1_1_sine_waveform_generator.html">  177</a></span>&#160;<span class="keyword">class </span><a class="code" href="classfabgl_1_1_sine_waveform_generator.html">SineWaveformGenerator</a> : <span class="keyword">public</span> <a class="code" href="classfabgl_1_1_waveform_generator.html">WaveformGenerator</a> {</div><div class="line"><a name="l00178"></a><span class="lineno">  178</span>&#160;<span class="keyword">public</span>:</div><div class="line"><a name="l00179"></a><span class="lineno">  179</span>&#160;  <a class="code" href="classfabgl_1_1_sine_waveform_generator.html">SineWaveformGenerator</a>();</div><div class="line"><a name="l00180"></a><span class="lineno">  180</span>&#160;</div><div class="line"><a name="l00181"></a><span class="lineno">  181</span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classfabgl_1_1_sine_waveform_generator_a5b5c30c147988a4bef2b08394984079d.html#a5b5c30c147988a4bef2b08394984079d">setFrequency</a>(<span class="keywordtype">int</span> value);</div><div class="line"><a name="l00182"></a><span class="lineno">  182</span>&#160;</div><div class="line"><a name="l00183"></a><span class="lineno">  183</span>&#160;  <span class="keywordtype">int</span> <a class="code" href="classfabgl_1_1_sine_waveform_generator_a52c1060c5ab1219386569f2cc39991b9.html#a52c1060c5ab1219386569f2cc39991b9">getSample</a>();</div><div class="line"><a name="l00184"></a><span class="lineno">  184</span>&#160;</div><div class="line"><a name="l00185"></a><span class="lineno">  185</span>&#160;<span class="keyword">private</span>:</div><div class="line"><a name="l00186"></a><span class="lineno">  186</span>&#160;  uint32_t m_phaseInc;</div><div class="line"><a name="l00187"></a><span class="lineno">  187</span>&#160;  uint32_t m_phaseAcc;</div><div class="line"><a name="l00188"></a><span class="lineno">  188</span>&#160;  uint16_t m_frequency;</div><div class="line"><a name="l00189"></a><span class="lineno">  189</span>&#160;  int16_t  m_lastSample;</div><div class="line"><a name="l00190"></a><span class="lineno">  190</span>&#160;};</div><div class="line"><a name="l00191"></a><span class="lineno">  191</span>&#160;</div><div class="line"><a name="l00192"></a><span class="lineno">  192</span>&#160;</div><div class="line"><a name="l00194"></a><span class="lineno"><a class="line" href="classfabgl_1_1_square_waveform_generator.html">  194</a></span>&#160;<span class="keyword">class </span><a class="code" href="classfabgl_1_1_square_waveform_generator.html">SquareWaveformGenerator</a> : <span class="keyword">public</span> <a class="code" href="classfabgl_1_1_waveform_generator.html">WaveformGenerator</a> {</div><div class="line"><a name="l00195"></a><span class="lineno">  195</span>&#160;<span class="keyword">public</span>:</div><div class="line"><a name="l00196"></a><span class="lineno">  196</span>&#160;  <a class="code" href="classfabgl_1_1_square_waveform_generator.html">SquareWaveformGenerator</a>();</div><div class="line"><a name="l00197"></a><span class="lineno">  197</span>&#160;</div><div class="line"><a name="l00198"></a><span class="lineno">  198</span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classfabgl_1_1_square_waveform_generator_a5b5c30c147988a4bef2b08394984079d.html#a5b5c30c147988a4bef2b08394984079d">setFrequency</a>(<span class="keywordtype">int</span> value);</div><div class="line"><a name="l00199"></a><span class="lineno">  199</span>&#160;</div><div class="line"><a name="l00205"></a><span class="lineno">  205</span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classfabgl_1_1_square_waveform_generator_a5719e6bf55f3f485e6b82e7800acf004.html#a5719e6bf55f3f485e6b82e7800acf004">setDutyCycle</a>(<span class="keywordtype">int</span> dutyCycle);</div><div class="line"><a name="l00206"></a><span class="lineno">  206</span>&#160;</div><div class="line"><a name="l00207"></a><span class="lineno">  207</span>&#160;  <span class="keywordtype">int</span> <a class="code" href="classfabgl_1_1_square_waveform_generator_a52c1060c5ab1219386569f2cc39991b9.html#a52c1060c5ab1219386569f2cc39991b9">getSample</a>();</div><div class="line"><a name="l00208"></a><span class="lineno">  208</span>&#160;</div><div class="line"><a name="l00209"></a><span class="lineno">  209</span>&#160;<span class="keyword">private</span>:</div><div class="line"><a name="l00210"></a><span class="lineno">  210</span>&#160;  uint32_t m_phaseInc;</div><div class="line"><a name="l00211"></a><span class="lineno">  211</span>&#160;  uint32_t m_phaseAcc;</div><div class="line"><a name="l00212"></a><span class="lineno">  212</span>&#160;  uint16_t m_frequency;</div><div class="line"><a name="l00213"></a><span class="lineno">  213</span>&#160;  int8_t   m_lastSample;</div><div class="line"><a name="l00214"></a><span class="lineno">  214</span>&#160;  uint8_t  m_dutyCycle;</div><div class="line"><a name="l00215"></a><span class="lineno">  215</span>&#160;};</div><div class="line"><a name="l00216"></a><span class="lineno">  216</span>&#160;</div><div class="line"><a name="l00217"></a><span class="lineno">  217</span>&#160;</div><div class="line"><a name="l00219"></a><span class="lineno"><a class="line" href="classfabgl_1_1_triangle_waveform_generator.html">  219</a></span>&#160;<span class="keyword">class </span><a class="code" href="classfabgl_1_1_triangle_waveform_generator.html">TriangleWaveformGenerator</a> : <span class="keyword">public</span> <a class="code" href="classfabgl_1_1_waveform_generator.html">WaveformGenerator</a> {</div><div class="line"><a name="l00220"></a><span class="lineno">  220</span>&#160;<span class="keyword">public</span>:</div><div class="line"><a name="l00221"></a><span class="lineno">  221</span>&#160;  <a class="code" href="classfabgl_1_1_triangle_waveform_generator.html">TriangleWaveformGenerator</a>();</div><div class="line"><a name="l00222"></a><span class="lineno">  222</span>&#160;</div><div class="line"><a name="l00223"></a><span class="lineno">  223</span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classfabgl_1_1_triangle_waveform_generator_a5b5c30c147988a4bef2b08394984079d.html#a5b5c30c147988a4bef2b08394984079d">setFrequency</a>(<span class="keywordtype">int</span> value);</div><div class="line"><a name="l00224"></a><span class="lineno">  224</span>&#160;</div><div class="line"><a name="l00225"></a><span class="lineno">  225</span>&#160;  <span class="keywordtype">int</span> <a class="code" href="classfabgl_1_1_triangle_waveform_generator_a52c1060c5ab1219386569f2cc39991b9.html#a52c1060c5ab1219386569f2cc39991b9">getSample</a>();</div><div class="line"><a name="l00226"></a><span class="lineno">  226</span>&#160;</div><div class="line"><a name="l00227"></a><span class="lineno">  227</span>&#160;<span class="keyword">private</span>:</div><div class="line"><a name="l00228"></a><span class="lineno">  228</span>&#160;  uint32_t m_phaseInc;</div><div class="line"><a name="l00229"></a><span class="lineno">  229</span>&#160;  uint32_t m_phaseAcc;</div><div class="line"><a name="l00230"></a><span class="lineno">  230</span>&#160;  uint16_t m_frequency;</div><div class="line"><a name="l00231"></a><span class="lineno">  231</span>&#160;  int8_t   m_lastSample;</div><div class="line"><a name="l00232"></a><span class="lineno">  232</span>&#160;};</div><div class="line"><a name="l00233"></a><span class="lineno">  233</span>&#160;</div><div class="line"><a name="l00234"></a><span class="lineno">  234</span>&#160;</div><div class="line"><a name="l00236"></a><span class="lineno"><a class="line" href="classfabgl_1_1_sawtooth_waveform_generator.html">  236</a></span>&#160;<span class="keyword">class </span><a class="code" href="classfabgl_1_1_sawtooth_waveform_generator.html">SawtoothWaveformGenerator</a> : <span class="keyword">public</span> <a class="code" href="classfabgl_1_1_waveform_generator.html">WaveformGenerator</a> {</div><div class="line"><a name="l00237"></a><span class="lineno">  237</span>&#160;<span class="keyword">public</span>:</div><div class="line"><a name="l00238"></a><span class="lineno">  238</span>&#160;  <a class="code" href="classfabgl_1_1_sawtooth_waveform_generator.html">SawtoothWaveformGenerator</a>();</div><div class="line"><a name="l00239"></a><span class="lineno">  239</span>&#160;</div><div class="line"><a name="l00240"></a><span class="lineno">  240</span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classfabgl_1_1_sawtooth_waveform_generator_a5b5c30c147988a4bef2b08394984079d.html#a5b5c30c147988a4bef2b08394984079d">setFrequency</a>(<span class="keywordtype">int</span> value);</div><div class="line"><a name="l00241"></a><span class="lineno">  241</span>&#160;</div><div class="line"><a name="l00242"></a><span class="lineno">  242</span>&#160;  <span class="keywordtype">int</span> <a class="code" href="classfabgl_1_1_sawtooth_waveform_generator_a52c1060c5ab1219386569f2cc39991b9.html#a52c1060c5ab1219386569f2cc39991b9">getSample</a>();</div><div class="line"><a name="l00243"></a><span class="lineno">  243</span>&#160;</div><div class="line"><a name="l00244"></a><span class="lineno">  244</span>&#160;<span class="keyword">private</span>:</div><div class="line"><a name="l00245"></a><span class="lineno">  245</span>&#160;  uint32_t m_phaseInc;</div><div class="line"><a name="l00246"></a><span class="lineno">  246</span>&#160;  uint32_t m_phaseAcc;</div><div class="line"><a name="l00247"></a><span class="lineno">  247</span>&#160;  uint16_t m_frequency;</div><div class="line"><a name="l00248"></a><span class="lineno">  248</span>&#160;  int8_t   m_lastSample;</div><div class="line"><a name="l00249"></a><span class="lineno">  249</span>&#160;};</div><div class="line"><a name="l00250"></a><span class="lineno">  250</span>&#160;</div><div class="line"><a name="l00251"></a><span class="lineno">  251</span>&#160;</div><div class="line"><a name="l00253"></a><span class="lineno"><a class="line" href="classfabgl_1_1_noise_waveform_generator.html">  253</a></span>&#160;<span class="keyword">class </span><a class="code" href="classfabgl_1_1_noise_waveform_generator.html">NoiseWaveformGenerator</a> : <span class="keyword">public</span> <a class="code" href="classfabgl_1_1_waveform_generator.html">WaveformGenerator</a> {</div><div class="line"><a name="l00254"></a><span class="lineno">  254</span>&#160;<span class="keyword">public</span>:</div><div class="line"><a name="l00255"></a><span class="lineno">  255</span>&#160;  <a class="code" href="classfabgl_1_1_noise_waveform_generator.html">NoiseWaveformGenerator</a>();</div><div class="line"><a name="l00256"></a><span class="lineno">  256</span>&#160;</div><div class="line"><a name="l00257"></a><span class="lineno">  257</span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classfabgl_1_1_noise_waveform_generator_a5b5c30c147988a4bef2b08394984079d.html#a5b5c30c147988a4bef2b08394984079d">setFrequency</a>(<span class="keywordtype">int</span> value);</div><div class="line"><a name="l00258"></a><span class="lineno">  258</span>&#160;</div><div class="line"><a name="l00259"></a><span class="lineno">  259</span>&#160;  <span class="keywordtype">int</span> <a class="code" href="classfabgl_1_1_noise_waveform_generator_a52c1060c5ab1219386569f2cc39991b9.html#a52c1060c5ab1219386569f2cc39991b9">getSample</a>();</div><div class="line"><a name="l00260"></a><span class="lineno">  260</span>&#160;</div><div class="line"><a name="l00261"></a><span class="lineno">  261</span>&#160;<span class="keyword">private</span>:</div><div class="line"><a name="l00262"></a><span class="lineno">  262</span>&#160;  uint16_t m_noise;</div><div class="line"><a name="l00263"></a><span class="lineno">  263</span>&#160;};</div><div class="line"><a name="l00264"></a><span class="lineno">  264</span>&#160;</div><div class="line"><a name="l00265"></a><span class="lineno">  265</span>&#160;</div><div class="line"><a name="l00267"></a><span class="lineno">  267</span>&#160;<span class="comment">// &quot;tries&quot; to emulate VIC6561 noise generator</span></div><div class="line"><a name="l00268"></a><span class="lineno">  268</span>&#160;<span class="comment">// derived from a reverse enginnered VHDL code: http://www.denial.shamani.dk/bb/viewtopic.php?t=8733&amp;start=210</span></div><div class="line"><a name="l00269"></a><span class="lineno">  269</span>&#160;</div><div class="line"><a name="l00275"></a><span class="lineno"><a class="line" href="classfabgl_1_1_v_i_c_noise_generator.html">  275</a></span>&#160;<span class="keyword">class </span><a class="code" href="classfabgl_1_1_v_i_c_noise_generator.html">VICNoiseGenerator</a> : <span class="keyword">public</span> <a class="code" href="classfabgl_1_1_waveform_generator.html">WaveformGenerator</a> {</div><div class="line"><a name="l00276"></a><span class="lineno">  276</span>&#160;<span class="keyword">public</span>:</div><div class="line"><a name="l00277"></a><span class="lineno">  277</span>&#160;  <a class="code" href="classfabgl_1_1_v_i_c_noise_generator.html">VICNoiseGenerator</a>();</div><div class="line"><a name="l00278"></a><span class="lineno">  278</span>&#160;</div><div class="line"><a name="l00279"></a><span class="lineno">  279</span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classfabgl_1_1_v_i_c_noise_generator_a5b5c30c147988a4bef2b08394984079d.html#a5b5c30c147988a4bef2b08394984079d">setFrequency</a>(<span class="keywordtype">int</span> value);</div><div class="line"><a name="l00280"></a><span class="lineno">  280</span>&#160;  uint16_t frequency() { <span class="keywordflow">return</span> m_frequency; }</div><div class="line"><a name="l00281"></a><span class="lineno">  281</span>&#160;</div><div class="line"><a name="l00282"></a><span class="lineno">  282</span>&#160;  <span class="keywordtype">int</span> <a class="code" href="classfabgl_1_1_v_i_c_noise_generator_a52c1060c5ab1219386569f2cc39991b9.html#a52c1060c5ab1219386569f2cc39991b9">getSample</a>();</div><div class="line"><a name="l00283"></a><span class="lineno">  283</span>&#160;</div><div class="line"><a name="l00284"></a><span class="lineno">  284</span>&#160;<span class="keyword">private</span>:</div><div class="line"><a name="l00285"></a><span class="lineno">  285</span>&#160;  <span class="keyword">static</span> <span class="keyword">const</span> uint16_t LFSRINIT = 0x0202;</div><div class="line"><a name="l00286"></a><span class="lineno">  286</span>&#160;  <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">int</span>      CLK      = 4433618;</div><div class="line"><a name="l00287"></a><span class="lineno">  287</span>&#160;</div><div class="line"><a name="l00288"></a><span class="lineno">  288</span>&#160;  uint16_t m_frequency;</div><div class="line"><a name="l00289"></a><span class="lineno">  289</span>&#160;  uint16_t m_counter;</div><div class="line"><a name="l00290"></a><span class="lineno">  290</span>&#160;  uint16_t m_LFSR;</div><div class="line"><a name="l00291"></a><span class="lineno">  291</span>&#160;  uint16_t m_outSR;</div><div class="line"><a name="l00292"></a><span class="lineno">  292</span>&#160;};</div><div class="line"><a name="l00293"></a><span class="lineno">  293</span>&#160;</div><div class="line"><a name="l00294"></a><span class="lineno">  294</span>&#160;</div><div class="line"><a name="l00295"></a><span class="lineno">  295</span>&#160;</div><div class="line"><a name="l00302"></a><span class="lineno"><a class="line" href="classfabgl_1_1_samples_generator.html">  302</a></span>&#160;<span class="keyword">class </span><a class="code" href="classfabgl_1_1_samples_generator.html">SamplesGenerator</a> : <span class="keyword">public</span> <a class="code" href="classfabgl_1_1_waveform_generator.html">WaveformGenerator</a> {</div><div class="line"><a name="l00303"></a><span class="lineno">  303</span>&#160;<span class="keyword">public</span>:</div><div class="line"><a name="l00304"></a><span class="lineno">  304</span>&#160;  <a class="code" href="classfabgl_1_1_samples_generator.html">SamplesGenerator</a>(int8_t <span class="keyword">const</span> * <a class="code" href="displaycontroller_8h_a96db82e580e46e24e2b39dd6c5bf7c21.html#a96db82e580e46e24e2b39dd6c5bf7c21">data</a>, <span class="keywordtype">int</span> length);</div><div class="line"><a name="l00305"></a><span class="lineno">  305</span>&#160;</div><div class="line"><a name="l00306"></a><span class="lineno">  306</span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classfabgl_1_1_samples_generator_a5b5c30c147988a4bef2b08394984079d.html#a5b5c30c147988a4bef2b08394984079d">setFrequency</a>(<span class="keywordtype">int</span> value);</div><div class="line"><a name="l00307"></a><span class="lineno">  307</span>&#160;</div><div class="line"><a name="l00308"></a><span class="lineno">  308</span>&#160;  <span class="keywordtype">int</span> <a class="code" href="classfabgl_1_1_samples_generator_a52c1060c5ab1219386569f2cc39991b9.html#a52c1060c5ab1219386569f2cc39991b9">getSample</a>();</div><div class="line"><a name="l00309"></a><span class="lineno">  309</span>&#160;</div><div class="line"><a name="l00310"></a><span class="lineno">  310</span>&#160;<span class="keyword">private</span>:</div><div class="line"><a name="l00311"></a><span class="lineno">  311</span>&#160;  int8_t <span class="keyword">const</span> * m_data;</div><div class="line"><a name="l00312"></a><span class="lineno">  312</span>&#160;  <span class="keywordtype">int</span>            m_length;</div><div class="line"><a name="l00313"></a><span class="lineno">  313</span>&#160;  <span class="keywordtype">int</span>            m_index;</div><div class="line"><a name="l00314"></a><span class="lineno">  314</span>&#160;};</div><div class="line"><a name="l00315"></a><span class="lineno">  315</span>&#160;</div><div class="line"><a name="l00316"></a><span class="lineno">  316</span>&#160;</div><div class="line"><a name="l00320"></a><span class="lineno">  320</span>&#160;<span class="keyword">enum class</span> SoundGeneratorState {</div><div class="line"><a name="l00321"></a><span class="lineno">  321</span>&#160;  Stop,             </div><div class="line"><a name="l00322"></a><span class="lineno">  322</span>&#160;  RequestToPlay,    </div><div class="line"><a name="l00323"></a><span class="lineno">  323</span>&#160;  Playing,          </div><div class="line"><a name="l00324"></a><span class="lineno">  324</span>&#160;  RequestToStop,    </div><div class="line"><a name="l00325"></a><span class="lineno">  325</span>&#160;};</div><div class="line"><a name="l00326"></a><span class="lineno">  326</span>&#160;</div><div class="line"><a name="l00327"></a><span class="lineno">  327</span>&#160;</div><div class="line"><a name="l00344"></a><span class="lineno"><a class="line" href="classfabgl_1_1_sound_generator.html">  344</a></span>&#160;<span class="keyword">class </span><a class="code" href="classfabgl_1_1_sound_generator.html">SoundGenerator</a> {</div><div class="line"><a name="l00345"></a><span class="lineno">  345</span>&#160;</div><div class="line"><a name="l00346"></a><span class="lineno">  346</span>&#160;<span class="keyword">public</span>:</div><div class="line"><a name="l00347"></a><span class="lineno">  347</span>&#160;</div><div class="line"><a name="l00351"></a><span class="lineno">  351</span>&#160;  <a class="code" href="classfabgl_1_1_sound_generator_a9137f26490315305b1fc3bc796a8e924.html#a9137f26490315305b1fc3bc796a8e924">SoundGenerator</a>(<span class="keywordtype">int</span> sampleRate = DEFAULT_SAMPLE_RATE);</div><div class="line"><a name="l00352"></a><span class="lineno">  352</span>&#160;</div><div class="line"><a name="l00353"></a><span class="lineno">  353</span>&#160;  ~<a class="code" href="classfabgl_1_1_sound_generator.html">SoundGenerator</a>();</div><div class="line"><a name="l00354"></a><span class="lineno">  354</span>&#160;</div><div class="line"><a name="l00358"></a><span class="lineno">  358</span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classfabgl_1_1_sound_generator_ac8bb3912a3ce86b15842e79d0b421204.html#ac8bb3912a3ce86b15842e79d0b421204">clear</a>();</div><div class="line"><a name="l00359"></a><span class="lineno">  359</span>&#160;</div><div class="line"><a name="l00371"></a><span class="lineno">  371</span>&#160;  <span class="keywordtype">bool</span> <a class="code" href="classfabgl_1_1_sound_generator_aa7c56b84cb4738b6826e34ca20993d62.html#aa7c56b84cb4738b6826e34ca20993d62">play</a>(<span class="keywordtype">bool</span> value);</div><div class="line"><a name="l00372"></a><span class="lineno">  372</span>&#160;</div><div class="line"><a name="l00386"></a><span class="lineno">  386</span>&#160;  <a class="code" href="classfabgl_1_1_samples_generator.html">SamplesGenerator</a> * <a class="code" href="classfabgl_1_1_sound_generator_a7ba0033bdfb41d5d58fc63a160f311f6.html#a7ba0033bdfb41d5d58fc63a160f311f6">playSamples</a>(int8_t <span class="keyword">const</span> * <a class="code" href="displaycontroller_8h_a96db82e580e46e24e2b39dd6c5bf7c21.html#a96db82e580e46e24e2b39dd6c5bf7c21">data</a>, <span class="keywordtype">int</span> length, <span class="keywordtype">int</span> <a class="code" href="classfabgl_1_1_sound_generator_a56fd55a21e8060769938c33ac16ee4f2.html#a56fd55a21e8060769938c33ac16ee4f2">volume</a> = 100, <span class="keywordtype">int</span> durationMS = 0);</div><div class="line"><a name="l00387"></a><span class="lineno">  387</span>&#160;</div><div class="line"><a name="l00409"></a><span class="lineno">  409</span>&#160;  <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div><div class="line"><a name="l00410"></a><span class="lineno"><a class="line" href="classfabgl_1_1_sound_generator_ab9e699f42faf36a58fc0f2ce0b014d39.html#ab9e699f42faf36a58fc0f2ce0b014d39">  410</a></span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classfabgl_1_1_sound_generator_ab9e699f42faf36a58fc0f2ce0b014d39.html#ab9e699f42faf36a58fc0f2ce0b014d39">playSound</a>(T <span class="keyword">const</span> &amp; waveform, <span class="keywordtype">int</span> frequency, <span class="keywordtype">int</span> durationMS, <span class="keywordtype">int</span> <a class="code" href="classfabgl_1_1_sound_generator_a56fd55a21e8060769938c33ac16ee4f2.html#a56fd55a21e8060769938c33ac16ee4f2">volume</a> = 100) {</div><div class="line"><a name="l00411"></a><span class="lineno">  411</span>&#160;    <span class="keyword">auto</span> wf = <span class="keyword">new</span> T(waveform);</div><div class="line"><a name="l00412"></a><span class="lineno">  412</span>&#160;    <a class="code" href="classfabgl_1_1_sound_generator_a04178c4d1679101843945ecfe8c8d3e1.html#a04178c4d1679101843945ecfe8c8d3e1">attach</a>(wf);</div><div class="line"><a name="l00413"></a><span class="lineno">  413</span>&#160;    wf-&gt;setFrequency(frequency);</div><div class="line"><a name="l00414"></a><span class="lineno">  414</span>&#160;    wf-&gt;setVolume(<a class="code" href="classfabgl_1_1_sound_generator_a56fd55a21e8060769938c33ac16ee4f2.html#a56fd55a21e8060769938c33ac16ee4f2">volume</a>);</div><div class="line"><a name="l00415"></a><span class="lineno">  415</span>&#160;    wf-&gt;setAutoDestroy(<span class="keyword">true</span>);</div><div class="line"><a name="l00416"></a><span class="lineno">  416</span>&#160;    wf-&gt;setDuration(m_sampleRate / 1000 * durationMS);</div><div class="line"><a name="l00417"></a><span class="lineno">  417</span>&#160;    wf-&gt;enable(<span class="keyword">true</span>);</div><div class="line"><a name="l00418"></a><span class="lineno">  418</span>&#160;    <a class="code" href="classfabgl_1_1_sound_generator_aa7c56b84cb4738b6826e34ca20993d62.html#aa7c56b84cb4738b6826e34ca20993d62">play</a>(<span class="keyword">true</span>);</div><div class="line"><a name="l00419"></a><span class="lineno">  419</span>&#160;  }</div><div class="line"><a name="l00420"></a><span class="lineno">  420</span>&#160;</div><div class="line"><a name="l00426"></a><span class="lineno"><a class="line" href="classfabgl_1_1_sound_generator_a88c86d325a9e0c70437469be339f65ee.html#a88c86d325a9e0c70437469be339f65ee">  426</a></span>&#160;  <span class="keywordtype">bool</span> <a class="code" href="classfabgl_1_1_sound_generator_a88c86d325a9e0c70437469be339f65ee.html#a88c86d325a9e0c70437469be339f65ee">playing</a>() { <span class="keywordflow">return</span> m_play; }</div><div class="line"><a name="l00427"></a><span class="lineno">  427</span>&#160;</div><div class="line"><a name="l00428"></a><span class="lineno">  428</span>&#160;  <a class="code" href="classfabgl_1_1_waveform_generator.html">WaveformGenerator</a> * channels() { <span class="keywordflow">return</span> m_channels; }</div><div class="line"><a name="l00429"></a><span class="lineno">  429</span>&#160;</div><div class="line"><a name="l00442"></a><span class="lineno">  442</span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classfabgl_1_1_sound_generator_a04178c4d1679101843945ecfe8c8d3e1.html#a04178c4d1679101843945ecfe8c8d3e1">attach</a>(WaveformGenerator * value);</div><div class="line"><a name="l00443"></a><span class="lineno">  443</span>&#160;</div><div class="line"><a name="l00449"></a><span class="lineno">  449</span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classfabgl_1_1_sound_generator_a15a8d9231086fe5e0cec746e00b87144.html#a15a8d9231086fe5e0cec746e00b87144">detach</a>(WaveformGenerator * value);</div><div class="line"><a name="l00450"></a><span class="lineno">  450</span>&#160;</div><div class="line"><a name="l00456"></a><span class="lineno"><a class="line" href="classfabgl_1_1_sound_generator_a77a669d4f95b8abf529a7d3183acb432.html#a77a669d4f95b8abf529a7d3183acb432">  456</a></span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classfabgl_1_1_sound_generator_a77a669d4f95b8abf529a7d3183acb432.html#a77a669d4f95b8abf529a7d3183acb432">setVolume</a>(<span class="keywordtype">int</span> value) { m_volume = value; }</div><div class="line"><a name="l00457"></a><span class="lineno">  457</span>&#160;</div><div class="line"><a name="l00463"></a><span class="lineno"><a class="line" href="classfabgl_1_1_sound_generator_a56fd55a21e8060769938c33ac16ee4f2.html#a56fd55a21e8060769938c33ac16ee4f2">  463</a></span>&#160;  <span class="keywordtype">int</span> <a class="code" href="classfabgl_1_1_sound_generator_a56fd55a21e8060769938c33ac16ee4f2.html#a56fd55a21e8060769938c33ac16ee4f2">volume</a>() { <span class="keywordflow">return</span> m_volume; }</div><div class="line"><a name="l00464"></a><span class="lineno">  464</span>&#160;</div><div class="line"><a name="l00465"></a><span class="lineno">  465</span>&#160;</div><div class="line"><a name="l00466"></a><span class="lineno">  466</span>&#160;<span class="keyword">private</span>:</div><div class="line"><a name="l00467"></a><span class="lineno">  467</span>&#160;</div><div class="line"><a name="l00468"></a><span class="lineno">  468</span>&#160;  <span class="keywordtype">void</span> i2s_audio_init();</div><div class="line"><a name="l00469"></a><span class="lineno">  469</span>&#160;  <span class="keyword">static</span> <span class="keywordtype">void</span> waveGenTask(<span class="keywordtype">void</span> * arg);</div><div class="line"><a name="l00470"></a><span class="lineno">  470</span>&#160;  <span class="keywordtype">bool</span> forcePlay(<span class="keywordtype">bool</span> value);</div><div class="line"><a name="l00471"></a><span class="lineno">  471</span>&#160;  <span class="keywordtype">void</span> mutizeOutput();</div><div class="line"><a name="l00472"></a><span class="lineno">  472</span>&#160;  <span class="keywordtype">void</span> detachNoSuspend(<a class="code" href="classfabgl_1_1_waveform_generator.html">WaveformGenerator</a> * value);</div><div class="line"><a name="l00473"></a><span class="lineno">  473</span>&#160;  <span class="keywordtype">bool</span> actualPlaying();</div><div class="line"><a name="l00474"></a><span class="lineno">  474</span>&#160;</div><div class="line"><a name="l00475"></a><span class="lineno">  475</span>&#160;</div><div class="line"><a name="l00476"></a><span class="lineno">  476</span>&#160;  TaskHandle_t        m_waveGenTaskHandle;</div><div class="line"><a name="l00477"></a><span class="lineno">  477</span>&#160;</div><div class="line"><a name="l00478"></a><span class="lineno">  478</span>&#160;  <a class="code" href="classfabgl_1_1_waveform_generator.html">WaveformGenerator</a> * m_channels;</div><div class="line"><a name="l00479"></a><span class="lineno">  479</span>&#160;</div><div class="line"><a name="l00480"></a><span class="lineno">  480</span>&#160;  uint16_t *          m_sampleBuffer;</div><div class="line"><a name="l00481"></a><span class="lineno">  481</span>&#160;</div><div class="line"><a name="l00482"></a><span class="lineno">  482</span>&#160;  int8_t              m_volume;</div><div class="line"><a name="l00483"></a><span class="lineno">  483</span>&#160;</div><div class="line"><a name="l00484"></a><span class="lineno">  484</span>&#160;  uint16_t            m_sampleRate;</div><div class="line"><a name="l00485"></a><span class="lineno">  485</span>&#160;</div><div class="line"><a name="l00486"></a><span class="lineno">  486</span>&#160;  <span class="keywordtype">bool</span>                m_play;</div><div class="line"><a name="l00487"></a><span class="lineno">  487</span>&#160;  SoundGeneratorState m_state;</div><div class="line"><a name="l00488"></a><span class="lineno">  488</span>&#160;  SemaphoreHandle_t   m_mutex;</div><div class="line"><a name="l00489"></a><span class="lineno">  489</span>&#160;</div><div class="line"><a name="l00490"></a><span class="lineno">  490</span>&#160;};</div><div class="line"><a name="l00491"></a><span class="lineno">  491</span>&#160;</div><div class="line"><a name="l00492"></a><span class="lineno">  492</span>&#160;</div><div class="line"><a name="l00493"></a><span class="lineno">  493</span>&#160;</div><div class="line"><a name="l00494"></a><span class="lineno">  494</span>&#160;</div><div class="line"><a name="l00495"></a><span class="lineno">  495</span>&#160;} <span class="comment">// end of namespace</span></div><div class="line"><a name="l00496"></a><span class="lineno">  496</span>&#160;</div><div class="ttc" id="classfabgl_1_1_noise_waveform_generator_html"><div class="ttname"><a href="classfabgl_1_1_noise_waveform_generator.html">fabgl::NoiseWaveformGenerator</a></div><div class="ttdoc">Noise generator. </div><div class="ttdef"><b>Definition:</b> <a href="soundgen_8h_source.html#l00253">soundgen.h:253</a></div></div>
<div class="ttc" id="classfabgl_1_1_waveform_generator_acafb7271189f6d844921794d61cd608a_html_acafb7271189f6d844921794d61cd608a"><div class="ttname"><a href="classfabgl_1_1_waveform_generator_acafb7271189f6d844921794d61cd608a.html#acafb7271189f6d844921794d61cd608a">fabgl::WaveformGenerator::enabled</a></div><div class="ttdeci">bool enabled()</div><div class="ttdoc">Determines whether this generator is enabled or disabled. </div><div class="ttdef"><b>Definition:</b> <a href="soundgen_8h_source.html#l00133">soundgen.h:133</a></div></div>
<div class="ttc" id="classfabgl_1_1_waveform_generator_a2670d55a6f6725717133799223effc61_html_a2670d55a6f6725717133799223effc61"><div class="ttname"><a href="classfabgl_1_1_waveform_generator_a2670d55a6f6725717133799223effc61.html#a2670d55a6f6725717133799223effc61">fabgl::WaveformGenerator::setAutoDestroy</a></div><div class="ttdeci">void setAutoDestroy(bool value)</div><div class="ttdoc">Sets autodestroy mode. </div><div class="ttdef"><b>Definition:</b> <a href="soundgen_8h_source.html#l00103">soundgen.h:103</a></div></div>
<div class="ttc" id="classfabgl_1_1_square_waveform_generator_a52c1060c5ab1219386569f2cc39991b9_html_a52c1060c5ab1219386569f2cc39991b9"><div class="ttname"><a href="classfabgl_1_1_square_waveform_generator_a52c1060c5ab1219386569f2cc39991b9.html#a52c1060c5ab1219386569f2cc39991b9">fabgl::SquareWaveformGenerator::getSample</a></div><div class="ttdeci">int getSample()</div><div class="ttdoc">Gets next sample. </div><div class="ttdef"><b>Definition:</b> <a href="soundgen_8cpp_source.html#l00164">soundgen.cpp:164</a></div></div>
<div class="ttc" id="classfabgl_1_1_sound_generator_a7ba0033bdfb41d5d58fc63a160f311f6_html_a7ba0033bdfb41d5d58fc63a160f311f6"><div class="ttname"><a href="classfabgl_1_1_sound_generator_a7ba0033bdfb41d5d58fc63a160f311f6.html#a7ba0033bdfb41d5d58fc63a160f311f6">fabgl::SoundGenerator::playSamples</a></div><div class="ttdeci">SamplesGenerator * playSamples(int8_t const *data, int length, int volume=100, int durationMS=0)</div><div class="ttdoc">Plays the specified samples. </div><div class="ttdef"><b>Definition:</b> <a href="soundgen_8cpp_source.html#l00534">soundgen.cpp:534</a></div></div>
<div class="ttc" id="classfabgl_1_1_sound_generator_ab9e699f42faf36a58fc0f2ce0b014d39_html_ab9e699f42faf36a58fc0f2ce0b014d39"><div class="ttname"><a href="classfabgl_1_1_sound_generator_ab9e699f42faf36a58fc0f2ce0b014d39.html#ab9e699f42faf36a58fc0f2ce0b014d39">fabgl::SoundGenerator::playSound</a></div><div class="ttdeci">void playSound(T const &amp;waveform, int frequency, int durationMS, int volume=100)</div><div class="ttdoc">Plays the specified waveform. </div><div class="ttdef"><b>Definition:</b> <a href="soundgen_8h_source.html#l00410">soundgen.h:410</a></div></div>
<div class="ttc" id="classfabgl_1_1_noise_waveform_generator_a5b5c30c147988a4bef2b08394984079d_html_a5b5c30c147988a4bef2b08394984079d"><div class="ttname"><a href="classfabgl_1_1_noise_waveform_generator_a5b5c30c147988a4bef2b08394984079d.html#a5b5c30c147988a4bef2b08394984079d">fabgl::NoiseWaveformGenerator::setFrequency</a></div><div class="ttdeci">void setFrequency(int value)</div><div class="ttdoc">Sets output frequency. </div><div class="ttdef"><b>Definition:</b> <a href="soundgen_8cpp_source.html#l00308">soundgen.cpp:308</a></div></div>
<div class="ttc" id="classfabgl_1_1_samples_generator_html"><div class="ttname"><a href="classfabgl_1_1_samples_generator.html">fabgl::SamplesGenerator</a></div><div class="ttdoc">Samples generator. </div><div class="ttdef"><b>Definition:</b> <a href="soundgen_8h_source.html#l00302">soundgen.h:302</a></div></div>
<div class="ttc" id="classfabgl_1_1_sawtooth_waveform_generator_a5b5c30c147988a4bef2b08394984079d_html_a5b5c30c147988a4bef2b08394984079d"><div class="ttname"><a href="classfabgl_1_1_sawtooth_waveform_generator_a5b5c30c147988a4bef2b08394984079d.html#a5b5c30c147988a4bef2b08394984079d">fabgl::SawtoothWaveformGenerator::setFrequency</a></div><div class="ttdeci">void setFrequency(int value)</div><div class="ttdoc">Sets output frequency. </div><div class="ttdef"><b>Definition:</b> <a href="soundgen_8cpp_source.html#l00259">soundgen.cpp:259</a></div></div>
<div class="ttc" id="classfabgl_1_1_triangle_waveform_generator_a52c1060c5ab1219386569f2cc39991b9_html_a52c1060c5ab1219386569f2cc39991b9"><div class="ttname"><a href="classfabgl_1_1_triangle_waveform_generator_a52c1060c5ab1219386569f2cc39991b9.html#a52c1060c5ab1219386569f2cc39991b9">fabgl::TriangleWaveformGenerator::getSample</a></div><div class="ttdeci">int getSample()</div><div class="ttdoc">Gets next sample. </div><div class="ttdef"><b>Definition:</b> <a href="soundgen_8cpp_source.html#l00215">soundgen.cpp:215</a></div></div>
<div class="ttc" id="classfabgl_1_1_waveform_generator_html"><div class="ttname"><a href="classfabgl_1_1_waveform_generator.html">fabgl::WaveformGenerator</a></div><div class="ttdoc">Base abstract class for waveform generators. A waveform generator can be seen as an audio channel tha...</div><div class="ttdef"><b>Definition:</b> <a href="soundgen_8h_source.html#l00062">soundgen.h:62</a></div></div>
<div class="ttc" id="classfabgl_1_1_triangle_waveform_generator_html"><div class="ttname"><a href="classfabgl_1_1_triangle_waveform_generator.html">fabgl::TriangleWaveformGenerator</a></div><div class="ttdoc">Triangle waveform generator. </div><div class="ttdef"><b>Definition:</b> <a href="soundgen_8h_source.html#l00219">soundgen.h:219</a></div></div>
<div class="ttc" id="classfabgl_1_1_samples_generator_a52c1060c5ab1219386569f2cc39991b9_html_a52c1060c5ab1219386569f2cc39991b9"><div class="ttname"><a href="classfabgl_1_1_samples_generator_a52c1060c5ab1219386569f2cc39991b9.html#a52c1060c5ab1219386569f2cc39991b9">fabgl::SamplesGenerator::getSample</a></div><div class="ttdeci">int getSample()</div><div class="ttdoc">Gets next sample. </div><div class="ttdef"><b>Definition:</b> <a href="soundgen_8cpp_source.html#l00430">soundgen.cpp:430</a></div></div>
<div class="ttc" id="classfabgl_1_1_samples_generator_a5b5c30c147988a4bef2b08394984079d_html_a5b5c30c147988a4bef2b08394984079d"><div class="ttname"><a href="classfabgl_1_1_samples_generator_a5b5c30c147988a4bef2b08394984079d.html#a5b5c30c147988a4bef2b08394984079d">fabgl::SamplesGenerator::setFrequency</a></div><div class="ttdeci">void setFrequency(int value)</div><div class="ttdoc">Sets output frequency. </div><div class="ttdef"><b>Definition:</b> <a href="soundgen_8cpp_source.html#l00425">soundgen.cpp:425</a></div></div>
<div class="ttc" id="classfabgl_1_1_sound_generator_a77a669d4f95b8abf529a7d3183acb432_html_a77a669d4f95b8abf529a7d3183acb432"><div class="ttname"><a href="classfabgl_1_1_sound_generator_a77a669d4f95b8abf529a7d3183acb432.html#a77a669d4f95b8abf529a7d3183acb432">fabgl::SoundGenerator::setVolume</a></div><div class="ttdeci">void setVolume(int value)</div><div class="ttdoc">Sets the overall volume. </div><div class="ttdef"><b>Definition:</b> <a href="soundgen_8h_source.html#l00456">soundgen.h:456</a></div></div>
<div class="ttc" id="displaycontroller_8h_a96db82e580e46e24e2b39dd6c5bf7c21_html_a96db82e580e46e24e2b39dd6c5bf7c21"><div class="ttname"><a href="displaycontroller_8h_a96db82e580e46e24e2b39dd6c5bf7c21.html#a96db82e580e46e24e2b39dd6c5bf7c21">data</a></div><div class="ttdeci">uint8_t const  * data</div><div class="ttdef"><b>Definition:</b> <a href="displaycontroller_8h_source.html#l00324">displaycontroller.h:324</a></div></div>
<div class="ttc" id="classfabgl_1_1_waveform_generator_a996f2f6c960641738fc46d3f39f6ef6f_html_a996f2f6c960641738fc46d3f39f6ef6f"><div class="ttname"><a href="classfabgl_1_1_waveform_generator_a996f2f6c960641738fc46d3f39f6ef6f.html#a996f2f6c960641738fc46d3f39f6ef6f">fabgl::WaveformGenerator::duration</a></div><div class="ttdeci">uint32_t duration()</div><div class="ttdoc">Returns number of remaining samples to play. </div><div class="ttdef"><b>Definition:</b> <a href="soundgen_8h_source.html#l00087">soundgen.h:87</a></div></div>
<div class="ttc" id="classfabgl_1_1_triangle_waveform_generator_a5b5c30c147988a4bef2b08394984079d_html_a5b5c30c147988a4bef2b08394984079d"><div class="ttname"><a href="classfabgl_1_1_triangle_waveform_generator_a5b5c30c147988a4bef2b08394984079d.html#a5b5c30c147988a4bef2b08394984079d">fabgl::TriangleWaveformGenerator::setFrequency</a></div><div class="ttdeci">void setFrequency(int value)</div><div class="ttdoc">Sets output frequency. </div><div class="ttdef"><b>Definition:</b> <a href="soundgen_8cpp_source.html#l00207">soundgen.cpp:207</a></div></div>
<div class="ttc" id="classfabgl_1_1_sound_generator_a04178c4d1679101843945ecfe8c8d3e1_html_a04178c4d1679101843945ecfe8c8d3e1"><div class="ttname"><a href="classfabgl_1_1_sound_generator_a04178c4d1679101843945ecfe8c8d3e1.html#a04178c4d1679101843945ecfe8c8d3e1">fabgl::SoundGenerator::attach</a></div><div class="ttdeci">void attach(WaveformGenerator *value)</div><div class="ttdoc">Attaches a waveform generator. </div><div class="ttdef"><b>Definition:</b> <a href="soundgen_8cpp_source.html#l00580">soundgen.cpp:580</a></div></div>
<div class="ttc" id="classfabgl_1_1_waveform_generator_a4d003299b7939c5c2a6fd8cee4fe7504_html_a4d003299b7939c5c2a6fd8cee4fe7504"><div class="ttname"><a href="classfabgl_1_1_waveform_generator_a4d003299b7939c5c2a6fd8cee4fe7504.html#a4d003299b7939c5c2a6fd8cee4fe7504">fabgl::WaveformGenerator::enable</a></div><div class="ttdeci">void enable(bool value)</div><div class="ttdoc">Enables or disabled this generator. </div><div class="ttdef"><b>Definition:</b> <a href="soundgen_8h_source.html#l00142">soundgen.h:142</a></div></div>
<div class="ttc" id="classfabgl_1_1_waveform_generator_ace43e846a26854aa34091e3eabd07f24_html_ace43e846a26854aa34091e3eabd07f24"><div class="ttname"><a href="classfabgl_1_1_waveform_generator_ace43e846a26854aa34091e3eabd07f24.html#ace43e846a26854aa34091e3eabd07f24">fabgl::WaveformGenerator::setAutoDetach</a></div><div class="ttdeci">void setAutoDetach(bool value)</div><div class="ttdoc">Sets autodetach mode. </div><div class="ttdef"><b>Definition:</b> <a href="soundgen_8h_source.html#l00094">soundgen.h:94</a></div></div>
<div class="ttc" id="classfabgl_1_1_waveform_generator_a85fa2eb2cf3e487be53c8b2625bdce69_html_a85fa2eb2cf3e487be53c8b2625bdce69"><div class="ttname"><a href="classfabgl_1_1_waveform_generator_a85fa2eb2cf3e487be53c8b2625bdce69.html#a85fa2eb2cf3e487be53c8b2625bdce69">fabgl::WaveformGenerator::setSampleRate</a></div><div class="ttdeci">void setSampleRate(int value)</div><div class="ttdoc">Sets the sample rate. </div><div class="ttdef"><b>Definition:</b> <a href="soundgen_8h_source.html#l00151">soundgen.h:151</a></div></div>
<div class="ttc" id="classfabgl_1_1_v_i_c_noise_generator_a52c1060c5ab1219386569f2cc39991b9_html_a52c1060c5ab1219386569f2cc39991b9"><div class="ttname"><a href="classfabgl_1_1_v_i_c_noise_generator_a52c1060c5ab1219386569f2cc39991b9.html#a52c1060c5ab1219386569f2cc39991b9">fabgl::VICNoiseGenerator::getSample</a></div><div class="ttdeci">int getSample()</div><div class="ttdoc">Gets next sample. </div><div class="ttdef"><b>Definition:</b> <a href="soundgen_8cpp_source.html#l00363">soundgen.cpp:363</a></div></div>
<div class="ttc" id="classfabgl_1_1_waveform_generator_aae62a0a75472fde81f63cd0f9d9288c2_html_aae62a0a75472fde81f63cd0f9d9288c2"><div class="ttname"><a href="classfabgl_1_1_waveform_generator_aae62a0a75472fde81f63cd0f9d9288c2.html#aae62a0a75472fde81f63cd0f9d9288c2">fabgl::WaveformGenerator::setDuration</a></div><div class="ttdeci">void setDuration(uint32_t value)</div><div class="ttdoc">Sets number of samples to play. </div><div class="ttdef"><b>Definition:</b> <a href="soundgen_8h_source.html#l00080">soundgen.h:80</a></div></div>
<div class="ttc" id="classfabgl_1_1_sound_generator_a88c86d325a9e0c70437469be339f65ee_html_a88c86d325a9e0c70437469be339f65ee"><div class="ttname"><a href="classfabgl_1_1_sound_generator_a88c86d325a9e0c70437469be339f65ee.html#a88c86d325a9e0c70437469be339f65ee">fabgl::SoundGenerator::playing</a></div><div class="ttdeci">bool playing()</div><div class="ttdoc">Determines whether sound generator is playing. </div><div class="ttdef"><b>Definition:</b> <a href="soundgen_8h_source.html#l00426">soundgen.h:426</a></div></div>
<div class="ttc" id="classfabgl_1_1_sound_generator_a56fd55a21e8060769938c33ac16ee4f2_html_a56fd55a21e8060769938c33ac16ee4f2"><div class="ttname"><a href="classfabgl_1_1_sound_generator_a56fd55a21e8060769938c33ac16ee4f2.html#a56fd55a21e8060769938c33ac16ee4f2">fabgl::SoundGenerator::volume</a></div><div class="ttdeci">int volume()</div><div class="ttdoc">Determines current overall volume. </div><div class="ttdef"><b>Definition:</b> <a href="soundgen_8h_source.html#l00463">soundgen.h:463</a></div></div>
<div class="ttc" id="fabutils_8h_html"><div class="ttname"><a href="fabutils_8h.html">fabutils.h</a></div><div class="ttdoc">This file contains some utility classes and functions. </div></div>
<div class="ttc" id="namespacefabgl_html"><div class="ttname"><a href="namespacefabgl.html">fabgl</a></div><div class="ttdef"><b>Definition:</b> <a href="canvas_8cpp_source.html#l00036">canvas.cpp:36</a></div></div>
<div class="ttc" id="classfabgl_1_1_sound_generator_ac8bb3912a3ce86b15842e79d0b421204_html_ac8bb3912a3ce86b15842e79d0b421204"><div class="ttname"><a href="classfabgl_1_1_sound_generator_ac8bb3912a3ce86b15842e79d0b421204.html#ac8bb3912a3ce86b15842e79d0b421204">fabgl::SoundGenerator::clear</a></div><div class="ttdeci">void clear()</div><div class="ttdoc">Stops playing and removes all attached waveform generators. </div><div class="ttdef"><b>Definition:</b> <a href="soundgen_8cpp_source.html#l00484">soundgen.cpp:484</a></div></div>
<div class="ttc" id="classfabgl_1_1_sine_waveform_generator_html"><div class="ttname"><a href="classfabgl_1_1_sine_waveform_generator.html">fabgl::SineWaveformGenerator</a></div><div class="ttdoc">Sine waveform generator. </div><div class="ttdef"><b>Definition:</b> <a href="soundgen_8h_source.html#l00177">soundgen.h:177</a></div></div>
<div class="ttc" id="classfabgl_1_1_sound_generator_a15a8d9231086fe5e0cec746e00b87144_html_a15a8d9231086fe5e0cec746e00b87144"><div class="ttname"><a href="classfabgl_1_1_sound_generator_a15a8d9231086fe5e0cec746e00b87144.html#a15a8d9231086fe5e0cec746e00b87144">fabgl::SoundGenerator::detach</a></div><div class="ttdeci">void detach(WaveformGenerator *value)</div><div class="ttdoc">Detaches a waveform generator. </div><div class="ttdef"><b>Definition:</b> <a href="soundgen_8cpp_source.html#l00595">soundgen.cpp:595</a></div></div>
<div class="ttc" id="classfabgl_1_1_sound_generator_aa7c56b84cb4738b6826e34ca20993d62_html_aa7c56b84cb4738b6826e34ca20993d62"><div class="ttname"><a href="classfabgl_1_1_sound_generator_aa7c56b84cb4738b6826e34ca20993d62.html#aa7c56b84cb4738b6826e34ca20993d62">fabgl::SoundGenerator::play</a></div><div class="ttdeci">bool play(bool value)</div><div class="ttdoc">Starts or stops playing. </div><div class="ttdef"><b>Definition:</b> <a href="soundgen_8cpp_source.html#l00520">soundgen.cpp:520</a></div></div>
<div class="ttc" id="classfabgl_1_1_sound_generator_html"><div class="ttname"><a href="classfabgl_1_1_sound_generator.html">fabgl::SoundGenerator</a></div><div class="ttdoc">SoundGenerator handles audio output. </div><div class="ttdef"><b>Definition:</b> <a href="soundgen_8h_source.html#l00344">soundgen.h:344</a></div></div>
<div class="ttc" id="classfabgl_1_1_v_i_c_noise_generator_html"><div class="ttname"><a href="classfabgl_1_1_v_i_c_noise_generator.html">fabgl::VICNoiseGenerator</a></div><div class="ttdoc">Emulates VIC6561 (VIC20) noise generator. </div><div class="ttdef"><b>Definition:</b> <a href="soundgen_8h_source.html#l00275">soundgen.h:275</a></div></div>
<div class="ttc" id="classfabgl_1_1_sawtooth_waveform_generator_a52c1060c5ab1219386569f2cc39991b9_html_a52c1060c5ab1219386569f2cc39991b9"><div class="ttname"><a href="classfabgl_1_1_sawtooth_waveform_generator_a52c1060c5ab1219386569f2cc39991b9.html#a52c1060c5ab1219386569f2cc39991b9">fabgl::SawtoothWaveformGenerator::getSample</a></div><div class="ttdeci">int getSample()</div><div class="ttdoc">Gets next sample. </div><div class="ttdef"><b>Definition:</b> <a href="soundgen_8cpp_source.html#l00267">soundgen.cpp:267</a></div></div>
<div class="ttc" id="classfabgl_1_1_waveform_generator_a77a669d4f95b8abf529a7d3183acb432_html_a77a669d4f95b8abf529a7d3183acb432"><div class="ttname"><a href="classfabgl_1_1_waveform_generator_a77a669d4f95b8abf529a7d3183acb432.html#a77a669d4f95b8abf529a7d3183acb432">fabgl::WaveformGenerator::setVolume</a></div><div class="ttdeci">void setVolume(int value)</div><div class="ttdoc">Sets volume of this generator. </div><div class="ttdef"><b>Definition:</b> <a href="soundgen_8h_source.html#l00119">soundgen.h:119</a></div></div>
<div class="ttc" id="classfabgl_1_1_v_i_c_noise_generator_a5b5c30c147988a4bef2b08394984079d_html_a5b5c30c147988a4bef2b08394984079d"><div class="ttname"><a href="classfabgl_1_1_v_i_c_noise_generator_a5b5c30c147988a4bef2b08394984079d.html#a5b5c30c147988a4bef2b08394984079d">fabgl::VICNoiseGenerator::setFrequency</a></div><div class="ttdeci">void setFrequency(int value)</div><div class="ttdoc">Sets output frequency. </div><div class="ttdef"><b>Definition:</b> <a href="soundgen_8cpp_source.html#l00352">soundgen.cpp:352</a></div></div>
<div class="ttc" id="classfabgl_1_1_sine_waveform_generator_a52c1060c5ab1219386569f2cc39991b9_html_a52c1060c5ab1219386569f2cc39991b9"><div class="ttname"><a href="classfabgl_1_1_sine_waveform_generator_a52c1060c5ab1219386569f2cc39991b9.html#a52c1060c5ab1219386569f2cc39991b9">fabgl::SineWaveformGenerator::getSample</a></div><div class="ttdeci">int getSample()</div><div class="ttdoc">Gets next sample. </div><div class="ttdef"><b>Definition:</b> <a href="soundgen_8cpp_source.html#l00101">soundgen.cpp:101</a></div></div>
<div class="ttc" id="classfabgl_1_1_waveform_generator_af6efc18f13f1cd2aeb2fb810b103b356_html_af6efc18f13f1cd2aeb2fb810b103b356"><div class="ttname"><a href="classfabgl_1_1_waveform_generator_af6efc18f13f1cd2aeb2fb810b103b356.html#af6efc18f13f1cd2aeb2fb810b103b356">fabgl::WaveformGenerator::getSample</a></div><div class="ttdeci">virtual int getSample()=0</div><div class="ttdoc">Gets next sample. </div></div>
<div class="ttc" id="fabglconf_8h_html"><div class="ttname"><a href="fabglconf_8h.html">fabglconf.h</a></div><div class="ttdoc">This file contains FabGL library configuration settings, like number of supported colors...</div></div>
<div class="ttc" id="classfabgl_1_1_sine_waveform_generator_a5b5c30c147988a4bef2b08394984079d_html_a5b5c30c147988a4bef2b08394984079d"><div class="ttname"><a href="classfabgl_1_1_sine_waveform_generator_a5b5c30c147988a4bef2b08394984079d.html#a5b5c30c147988a4bef2b08394984079d">fabgl::SineWaveformGenerator::setFrequency</a></div><div class="ttdeci">void setFrequency(int value)</div><div class="ttdoc">Sets output frequency. </div><div class="ttdef"><b>Definition:</b> <a href="soundgen_8cpp_source.html#l00093">soundgen.cpp:93</a></div></div>
<div class="ttc" id="classfabgl_1_1_square_waveform_generator_a5b5c30c147988a4bef2b08394984079d_html_a5b5c30c147988a4bef2b08394984079d"><div class="ttname"><a href="classfabgl_1_1_square_waveform_generator_a5b5c30c147988a4bef2b08394984079d.html#a5b5c30c147988a4bef2b08394984079d">fabgl::SquareWaveformGenerator::setFrequency</a></div><div class="ttdeci">void setFrequency(int value)</div><div class="ttdoc">Sets output frequency. </div><div class="ttdef"><b>Definition:</b> <a href="soundgen_8cpp_source.html#l00149">soundgen.cpp:149</a></div></div>
<div class="ttc" id="classfabgl_1_1_square_waveform_generator_a5719e6bf55f3f485e6b82e7800acf004_html_a5719e6bf55f3f485e6b82e7800acf004"><div class="ttname"><a href="classfabgl_1_1_square_waveform_generator_a5719e6bf55f3f485e6b82e7800acf004.html#a5719e6bf55f3f485e6b82e7800acf004">fabgl::SquareWaveformGenerator::setDutyCycle</a></div><div class="ttdeci">void setDutyCycle(int dutyCycle)</div><div class="ttdoc">Sets square wave duty cycle. </div><div class="ttdef"><b>Definition:</b> <a href="soundgen_8cpp_source.html#l00158">soundgen.cpp:158</a></div></div>
<div class="ttc" id="classfabgl_1_1_sawtooth_waveform_generator_html"><div class="ttname"><a href="classfabgl_1_1_sawtooth_waveform_generator.html">fabgl::SawtoothWaveformGenerator</a></div><div class="ttdoc">Sawtooth waveform generator. </div><div class="ttdef"><b>Definition:</b> <a href="soundgen_8h_source.html#l00236">soundgen.h:236</a></div></div>
<div class="ttc" id="classfabgl_1_1_waveform_generator_abc395029362d9990b5dad44dfafe9d63_html_abc395029362d9990b5dad44dfafe9d63"><div class="ttname"><a href="classfabgl_1_1_waveform_generator_abc395029362d9990b5dad44dfafe9d63.html#abc395029362d9990b5dad44dfafe9d63">fabgl::WaveformGenerator::sampleRate</a></div><div class="ttdeci">uint16_t sampleRate()</div><div class="ttdoc">Determines the sample rate. </div><div class="ttdef"><b>Definition:</b> <a href="soundgen_8h_source.html#l00158">soundgen.h:158</a></div></div>
<div class="ttc" id="classfabgl_1_1_noise_waveform_generator_a52c1060c5ab1219386569f2cc39991b9_html_a52c1060c5ab1219386569f2cc39991b9"><div class="ttname"><a href="classfabgl_1_1_noise_waveform_generator_a52c1060c5ab1219386569f2cc39991b9.html#a52c1060c5ab1219386569f2cc39991b9">fabgl::NoiseWaveformGenerator::getSample</a></div><div class="ttdeci">int getSample()</div><div class="ttdoc">Gets next sample. </div><div class="ttdef"><b>Definition:</b> <a href="soundgen_8cpp_source.html#l00313">soundgen.cpp:313</a></div></div>
<div class="ttc" id="classfabgl_1_1_waveform_generator_a56fd55a21e8060769938c33ac16ee4f2_html_a56fd55a21e8060769938c33ac16ee4f2"><div class="ttname"><a href="classfabgl_1_1_waveform_generator_a56fd55a21e8060769938c33ac16ee4f2.html#a56fd55a21e8060769938c33ac16ee4f2">fabgl::WaveformGenerator::volume</a></div><div class="ttdeci">int volume()</div><div class="ttdoc">Determines current volume. </div><div class="ttdef"><b>Definition:</b> <a href="soundgen_8h_source.html#l00126">soundgen.h:126</a></div></div>
<div class="ttc" id="classfabgl_1_1_sound_generator_a9137f26490315305b1fc3bc796a8e924_html_a9137f26490315305b1fc3bc796a8e924"><div class="ttname"><a href="classfabgl_1_1_sound_generator_a9137f26490315305b1fc3bc796a8e924.html#a9137f26490315305b1fc3bc796a8e924">fabgl::SoundGenerator::SoundGenerator</a></div><div class="ttdeci">SoundGenerator(int sampleRate=16000)</div><div class="ttdoc">Creates an instance of the sound generator. Only one instance is allowed. </div><div class="ttdef"><b>Definition:</b> <a href="soundgen_8cpp_source.html#l00461">soundgen.cpp:461</a></div></div>
<div class="ttc" id="classfabgl_1_1_square_waveform_generator_html"><div class="ttname"><a href="classfabgl_1_1_square_waveform_generator.html">fabgl::SquareWaveformGenerator</a></div><div class="ttdoc">Square waveform generator. </div><div class="ttdef"><b>Definition:</b> <a href="soundgen_8h_source.html#l00194">soundgen.h:194</a></div></div>
<div class="ttc" id="classfabgl_1_1_waveform_generator_a6d3ded07c8e0000d3f20c12ed801db7b_html_a6d3ded07c8e0000d3f20c12ed801db7b"><div class="ttname"><a href="classfabgl_1_1_waveform_generator_a6d3ded07c8e0000d3f20c12ed801db7b.html#a6d3ded07c8e0000d3f20c12ed801db7b">fabgl::WaveformGenerator::setFrequency</a></div><div class="ttdeci">virtual void setFrequency(int value)=0</div><div class="ttdoc">Sets output frequency. </div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_82e8a5453e51b0b6168db3257bd0eaab.html">devdrivers</a></li><li class="navelem"><a class="el" href="soundgen_8h.html">soundgen.h</a></li>
    <li class="footer">Generated on Mon Aug 2 2021 07:08:03 for FabGL by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.14 </li>
  </ul>
</div>
</body>
</html>
